import {
	defineConfig
} from 'vite'
import uni from '@dcloudio/vite-plugin-uni'
import UnoCSS from 'unocss/vite'
import {
	resolve
} from 'path'
import TransformPages from 'uni-read-pages-vite'

// https://vitejs.dev/config/
export default defineConfig({
	plugins: [
		UnoCSS(),
		uni(),
	],
	resolve: {
		alias: {
			'@': resolve('./src'),
		},
		extensions: ['.js', '.json', '.ts', '.vue'], // 省略的后缀名
	},
	define: {
		ROUTES: new TransformPages().routes, // 注入路由表
	}
})